package com.mkait.thief.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 微信素材表
 * @TableName wechat_news_article
 */
@TableName(value ="wechat_news_article")
@Data
public class WechatNewsArticle implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 素材标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 永久素材显示URL
     */
    @TableField(value = "local_url")
    private String localUrl;

    /**
     * 是否显示封面 0不显示，1 显示
     */
    @TableField(value = "show_cover_pic")
    private Integer showCoverPic;

    /**
     * 作者
     */
    @TableField(value = "author")
    private String author;

    /**
     * 摘要内容
     */
    @TableField(value = "digest")
    private String digest;

    /**
     * 图文内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 图文消息原文地址
     */
    @TableField(value = "content_source_url")
    private String contentSourceUrl;

    /**
     * 创建时间
     */
    @TableField(value = "create_at")
    private Date createAt;

    /**
     * 创建人
     */
    @TableField(value = "create_by")
    private Long createBy;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WechatNewsArticle other = (WechatNewsArticle) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getLocalUrl() == null ? other.getLocalUrl() == null : this.getLocalUrl().equals(other.getLocalUrl()))
            && (this.getShowCoverPic() == null ? other.getShowCoverPic() == null : this.getShowCoverPic().equals(other.getShowCoverPic()))
            && (this.getAuthor() == null ? other.getAuthor() == null : this.getAuthor().equals(other.getAuthor()))
            && (this.getDigest() == null ? other.getDigest() == null : this.getDigest().equals(other.getDigest()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getContentSourceUrl() == null ? other.getContentSourceUrl() == null : this.getContentSourceUrl().equals(other.getContentSourceUrl()))
            && (this.getCreateAt() == null ? other.getCreateAt() == null : this.getCreateAt().equals(other.getCreateAt()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getLocalUrl() == null) ? 0 : getLocalUrl().hashCode());
        result = prime * result + ((getShowCoverPic() == null) ? 0 : getShowCoverPic().hashCode());
        result = prime * result + ((getAuthor() == null) ? 0 : getAuthor().hashCode());
        result = prime * result + ((getDigest() == null) ? 0 : getDigest().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getContentSourceUrl() == null) ? 0 : getContentSourceUrl().hashCode());
        result = prime * result + ((getCreateAt() == null) ? 0 : getCreateAt().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", localUrl=").append(localUrl);
        sb.append(", showCoverPic=").append(showCoverPic);
        sb.append(", author=").append(author);
        sb.append(", digest=").append(digest);
        sb.append(", content=").append(content);
        sb.append(", contentSourceUrl=").append(contentSourceUrl);
        sb.append(", createAt=").append(createAt);
        sb.append(", createBy=").append(createBy);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}